package com.chenshuang.bean;

import java.math.BigDecimal;
import java.util.Objects;

public class CartGoods {
    private Goods goods;
    private Integer allgoodsnum=1;
    private BigDecimal allprice ;


    public CartGoods(Goods goods, Integer allgoodsnum,BigDecimal allprice) {
        this.goods = goods;
        this.allgoodsnum = allgoodsnum;
        this.allprice = allprice;

    }

    public CartGoods() {
    }

    public BigDecimal getAllprice() {

        return this.allprice;
    }

    public void setAllprice(BigDecimal allprice) {
        this.allprice = allprice;
    }

    public Integer getAllgoodsnum() {
        return allgoodsnum;
    }

    public void setAllgoodsnum(Integer allgoodsnum) {
        this.allgoodsnum = allgoodsnum;
    }

    public Goods getGoods() {
        return goods;
    }

    public void setGoods(Goods goods) {
        this.goods = goods;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CartGoods cartGoods = (CartGoods) o;
        return Objects.equals(allprice, cartGoods.allprice) && Objects.equals(allgoodsnum, cartGoods.allgoodsnum) && Objects.equals(goods, cartGoods.goods);
    }

    @Override
    public int hashCode() {
        return Objects.hash(allprice, allgoodsnum, goods);
    }

    @Override
    public String toString() {
        return "CartGoods{" +
                "allprice=" + allprice +
                ", allgoodsnum=" + allgoodsnum +
                ", goods=" + goods +
                '}';
    }
}
